﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Practices.Unity;
using Fdd.Aspen.Services.Web;
using Fdd.Aspen.DomainModel.Repositories;
using Fdd.Aspen.Repositories;
using Fdd.Aspen.Infrastructure.Data;
using System.Configuration;
using Fdd.Aspen.DomainModel.Repositories.Interfaces;

namespace Fdd.Aspen.Client.Web.Configuration
{
    public static class UnityContainerConfiguration
    {
        public readonly static IUnityContainer Container = new UnityContainer();

        
        public static IUnityContainer Configure()
        {

            Container.RegisterType<MemberDomainService>();
            Container.RegisterType<IMemberRepository, MemberRepository>();
            Container.RegisterType<IGatheringRepository, GatheringRepository>();
            Container.RegisterType<IObjectContext, WcfObjectContextAdapter>(new InjectionConstructor(new DefaultObjectContextFactory()));

            return Container;
        }


        private static string AspenConnectionString
        {
            get { return ConfigurationManager.ConnectionStrings["AspenConnectionString"].ConnectionString; }
        }
    }
}